import sqlite3


class Sqlite3DB:
    def login(self, alias, pwd) -> tuple | None:
        with sqlite3.connect('testdb.db') as conn:
            cursor = conn.cursor()
            cursor.execute("SELECT name, alias, team_role FROM users WHERE alias=:alias AND pwd= :pwd",
                           {'alias': alias, 'pwd': pwd})
            rows = cursor.fetchall()
            if len(rows) == 1:
                return rows[0]
            else:
                return None
